<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Hexo添加首页置顶轮播图 | 花猪のBlog</title><meta name="keywords" content="Hexo"><meta name="author" content="花猪,2296412185@qq.com"><meta name="copyright" content="花猪"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="本文将介绍如何在首页添加置顶轮播图">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo添加首页置顶轮播图">
<meta property="og:url" content="https://cnhuazhu.top/2021/03/28/Hexo%E9%AD%94%E6%94%B9/Hexo%E6%B7%BB%E5%8A%A0%E9%A6%96%E9%A1%B5%E7%BD%AE%E9%A1%B6%E8%BD%AE%E6%92%AD%E5%9B%BE/index.html">
<meta property="og:site_name" content="花猪のBlog">
<meta property="og:description" content="本文将介绍如何在首页添加置顶轮播图">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/hexo2.jpg">
<meta property="article:published_time" content="2021-03-28T11:30:01.000Z">
<meta property="article:modified_time" content="2021-03-28T12:09:35.349Z">
<meta property="article:author" content="花猪">
<meta property="article:tag" content="Hexo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/hexo2.jpg"><link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/avatar.jpg"><link rel="canonical" href="https://cnhuazhu.top/2021/03/28/Hexo%E9%AD%94%E6%94%B9/Hexo%E6%B7%BB%E5%8A%A0%E9%A6%96%E9%A1%B5%E7%BD%AE%E9%A1%B6%E8%BD%AE%E6%92%AD%E5%9B%BE/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":300},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":60,"languages":{"author":"作者: 花猪","link":"链接: ","source":"来源: 花猪のBlog","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#ABADAC","bgDark":"#121212","position":"bottom-right"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Hexo添加首页置顶轮播图',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-03-28 20:09:35'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    })(window)</script><link rel="stylesheet" href="/css/tag.css"><link rel="stylesheet" href="/css/pagelucency.css"><style>#article-container.post-content h1:before, h2:before, h3:before, h4:before, h5:before, h6:before { -webkit-animation: avatar_turn_around 1s linear infinite; -moz-animation: avatar_turn_around 1s linear infinite; -o-animation: avatar_turn_around 1s linear infinite; -ms-animation: avatar_turn_around 1s linear infinite; animation: avatar_turn_around 1s linear infinite; }</style><link rel="stylesheet" href="/css/avatarbg.css"><link rel="stylesheet" href="/css/footerlucency.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/macblack.css"><link rel="stylesheet" href="/css/mouse.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-butterfly-swiper/lib/swiper.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-butterfly-swiper/lib/swiperstyle.css"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.3.0"><link rel="alternate" href="/atom.xml" title="花猪のBlog" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="wizard-scene"><div class="wizard-objects"><div class="wizard-square"></div><div class="wizard-circle"></div><div class="wizard-triangle"></div></div><div class="wizard"><div class="wizard-body"></div><div class="wizard-right-arm"><div class="wizard-right-hand"></div></div><div class="wizard-left-arm"><div class="wizard-left-hand"></div></div><div class="wizard-head"><div class="wizard-beard"></div><div class="wizard-face"><div class="wizard-adds"></div></div><div class="wizard-hat"><div class="wizard-hat-of-the-hat"></div><div class="wizard-four-point-star --first"></div><div class="wizard-four-point-star --second"></div><div class="wizard-four-point-star --third"></div></div></div></div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">86</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="http://cnhuazhu.top/"><i class="fa-fw fas fa-gift"></i><span> 引导</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-sitemap"></i><span> 分站</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="http://cnhuazhu.top/next"><i class="fa-fw fas fa-chevron-right"></i><span> Next</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-list"></i><span> 文章</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-list"></i><span> 生活</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 图库</span></a></li><li><a class="site-page child" href="/books/"><i class="fa-fw fas fa-book"></i><span> 阅读</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-film"></i><span> 电影</span></a></li><li><a class="site-page child" href="/video/"><i class="fa-fw fa fa-video"></i><span> 视频</span></a></li><li><a class="site-page child" href="/artitalk/"><i class="fa-fw fas fa-quote-left"></i><span> 说说</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-list"></i><span> 链接</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></li><li><a class="site-page child" href="/website/"><i class="fa-fw fas fa-globe"></i><span> 网站</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/Message/"><i class="fa-fw fas fa-comment"></i><span> 留言</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fa fa-heart"></i><span> 关于</span></a></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background: transparent"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">花猪のBlog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="http://cnhuazhu.top/"><i class="fa-fw fas fa-gift"></i><span> 引导</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-sitemap"></i><span> 分站</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="http://cnhuazhu.top/next"><i class="fa-fw fas fa-chevron-right"></i><span> Next</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-list"></i><span> 文章</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-list"></i><span> 生活</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 图库</span></a></li><li><a class="site-page child" href="/books/"><i class="fa-fw fas fa-book"></i><span> 阅读</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-film"></i><span> 电影</span></a></li><li><a class="site-page child" href="/video/"><i class="fa-fw fa fa-video"></i><span> 视频</span></a></li><li><a class="site-page child" href="/artitalk/"><i class="fa-fw fas fa-quote-left"></i><span> 说说</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fas fa-list"></i><span> 链接</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></li><li><a class="site-page child" href="/website/"><i class="fa-fw fas fa-globe"></i><span> 网站</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/Message/"><i class="fa-fw fas fa-comment"></i><span> 留言</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fa fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Hexo添加首页置顶轮播图</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-03-28T11:30:01.000Z" title="发表于 2021-03-28 19:30:01">2021-03-28</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-03-28T12:09:35.349Z" title="更新于 2021-03-28 20:09:35">2021-03-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%8D%9A%E5%AE%A2/">博客</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1.4k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>7分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Hexo添加首页置顶轮播图"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1>前言</h1>
<p>在写系列博文时对于某一篇文章的寻找过程会比较繁琐（对于博主而言自然会简单些，但是对于访客来讲就没那么轻松），因此参考Akilar的博文弄了一个置顶轮播图。可以把系列博文的链接汇总起来做一个索引，放置在轮播图中。这样既可以展示博主想对外展示的内容，又方便快速进行文章跳转。</p>
<p>效果可以在博客首页查看。</p>
<blockquote>
<p>本篇教程会涉及大量源码的改动，对缩进有严格要求。如果需要，可以移步下方链接至Akilar的博客教程去下载源码。</p>
<p>教程链接：《Slider Bar》<a target="_blank" rel="noopener external nofollow noreferrer" href="https://akilar.top/posts/8e1264d1/">https://akilar.top/posts/8e1264d1/</a></p>
</blockquote>
<hr>
<h1>操作</h1>
<ol>
<li>
<p>在<code>\themes\butterfly\layout\includes</code>路径下创建文件<code>sliderbar.pug</code>，并将以下内容写入该文件：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">.blog-slider.swiper-container-fade.swiper-container-horizontal#swiper_container</span><br><span class="line">  .blog-slider__wrp.swiper-wrapper(style=&#x27;transition-duration: 0ms;&#x27;)</span><br><span class="line">    if site.data.slider</span><br><span class="line">      each i in site.data.slider</span><br><span class="line">        .blog-slider__item.swiper-slide(style=&#x27;width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;&#x27;)</span><br><span class="line">          a.blog-slider__img(href=url_for(i.link)  alt=&#x27;&#x27;)|</span><br><span class="line">            img(width=&#x27;48&#x27; height=&#x27;48&#x27; src=url_for(i.cover) onerror=`this.onerror=null;this.src=&#x27;` + url_for(theme.error_img.post_page) + `&#x27;`, alt=&#x27;&#x27;)</span><br><span class="line">          .blog-slider__content</span><br><span class="line">            span.blog-slider__code= i.timeline</span><br><span class="line">            a.blog-slider__title(href=url_for(i.link)  alt=&#x27;&#x27;)= i.title</span><br><span class="line">            .blog-slider__text= i.description</span><br><span class="line">            a.blog-slider__button(href=url_for(i.link)  alt=&#x27;&#x27;)= i.button      </span><br><span class="line">  .blog-slider__pagination.swiper-pagination-clickable.swiper-pagination-bullets</span><br><span class="line">script(defer src=url_for(theme.CDN.swiper_js))</span><br><span class="line">script(defer data-pjax src=url_for(theme.CDN.swiper_init))</span><br></pre></td></tr></table></figure>
</li>
<li>
<p>在路径<code>\themes\butterfly\layout</code>修改文件<code>index.pug</code>，添加以下两行代码（注意缩进）引入轮播图板块。</p>
<p>注意在<code>butterfly_v3.6.0</code>中取消了缓存配置，需要将<code>&#123;cache:theme.fragment_cache&#125;</code>改为<code>&#123;cache: true&#125;</code></p>
<figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">.recent-post-item(style=&#x27;height:auto;width:100%;&#x27;)</span><br><span class="line">  !=partial(&#x27;includes/sliderbar&#x27;, &#123;&#125;, &#123;cache:theme.fragment_cache&#125;)</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/LBT1.png" alt=""></p>
</li>
<li>
<p>在<code>\themes\butterfly\source\js</code>路径下，新建文件<code>swiper_init.js</code>，并将以下代码写入：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> swiper = <span class="keyword">new</span> Swiper(<span class="string">&#x27;.blog-slider&#x27;</span>, &#123;</span><br><span class="line">  passiveListeners: <span class="literal">true</span>,</span><br><span class="line">  spaceBetween: <span class="number">30</span>,</span><br><span class="line">  effect: <span class="string">&#x27;fade&#x27;</span>,</span><br><span class="line">  loop: <span class="literal">true</span>,</span><br><span class="line">  autoplay: &#123;</span><br><span class="line">    disableOnInteraction: <span class="literal">true</span>,</span><br><span class="line">    delay: <span class="number">3000</span></span><br><span class="line">  &#125;,</span><br><span class="line">  mousewheel: <span class="literal">false</span>,</span><br><span class="line">  <span class="comment">// autoHeight: true,</span></span><br><span class="line">  pagination: &#123;</span><br><span class="line">    el: <span class="string">&#x27;.blog-slider__pagination&#x27;</span>,</span><br><span class="line">    clickable: <span class="literal">true</span>,</span><br><span class="line">  &#125;</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> comtainer = <span class="built_in">document</span>.getElementById(<span class="string">&#x27;swiper_container&#x27;</span>);</span><br><span class="line">comtainer.onmouseenter = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">  swiper.autoplay.stop();</span><br><span class="line">&#125;;</span><br><span class="line">comtainer.onmouseleave = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">  swiper.autoplay.start();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li>
<p>在<code>\themes\butterfly\source\css\_layout</code>路径下，创建文件<code>swiperstyle.styl</code>，并将以下代码写入：</p>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br></pre></td><td class="code"><pre><span class="line">*</span><br><span class="line">  <span class="attribute">box-sizing</span> border-box</span><br><span class="line">div#swiper_container</span><br><span class="line">  <span class="attribute">background</span> rgba(<span class="number">255</span>, <span class="number">255</span>, <span class="number">255</span>, <span class="number">0</span>);</span><br><span class="line">.blog-slider</span><br><span class="line">  <span class="attribute">width</span> <span class="number">100%</span></span><br><span class="line">  <span class="attribute">position</span> relative</span><br><span class="line">  <span class="attribute">border-radius</span> <span class="number">12px</span> <span class="number">8px</span> <span class="number">8px</span> <span class="number">12px</span></span><br><span class="line">  <span class="attribute">margin</span> auto</span><br><span class="line">  <span class="attribute">background</span> var(--global-bg)</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">10px</span></span><br><span class="line">  transition all .3s</span><br><span class="line"></span><br><span class="line">.blog-slider__item</span><br><span class="line">  <span class="attribute">display</span> flex</span><br><span class="line">  <span class="attribute">align-items</span> center</span><br><span class="line">  &amp;.swiper-slide-active</span><br><span class="line">    .blog-slider__img</span><br><span class="line">      img</span><br><span class="line">        <span class="attribute">opacity</span> <span class="number">1</span></span><br><span class="line">        transition-delay .3s</span><br><span class="line">    .blog-slider__content</span><br><span class="line">      &amp; &gt; *</span><br><span class="line">        <span class="attribute">opacity</span> <span class="number">1</span></span><br><span class="line">        <span class="attribute">transform</span> none</span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">1</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.3s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">2</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.4s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">3</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.5s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">4</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.6s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">5</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.7s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">6</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.8s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">7</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">0.9s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">8</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">9</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.1s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">10</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.2s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">11</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.3s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">12</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.4s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">13</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.5s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">14</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.6s</span></span><br><span class="line">      &amp; &gt; *<span class="selector-pseudo">:nth-child</span>(<span class="number">15</span>)</span><br><span class="line">        <span class="attribute">transition-delay</span> <span class="number">1.7s</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">.blog-slider__img</span><br><span class="line">  <span class="attribute">width</span> <span class="number">200px</span></span><br><span class="line">  <span class="attribute">flex-shrink</span> <span class="number">0</span></span><br><span class="line">  <span class="attribute">height</span> <span class="number">200px</span></span><br><span class="line">  <span class="attribute">padding</span> <span class="number">10px</span></span><br><span class="line">  <span class="attribute">border-radius</span> <span class="number">5px</span></span><br><span class="line">  <span class="attribute">transform</span> translateX(<span class="number">0px</span>)</span><br><span class="line">  <span class="attribute">overflow</span> hidden</span><br><span class="line">  &amp;:after</span><br><span class="line">    <span class="attribute">content</span> <span class="string">&#x27;&#x27;</span></span><br><span class="line">    <span class="attribute">position</span> absolute</span><br><span class="line">    <span class="attribute">top</span> <span class="number">0</span></span><br><span class="line">    <span class="attribute">left</span> <span class="number">0</span></span><br><span class="line">    <span class="attribute">width</span> <span class="number">100%</span></span><br><span class="line">    <span class="attribute">height</span> <span class="number">100%</span></span><br><span class="line">    <span class="attribute">border-radius</span> <span class="number">5px</span></span><br><span class="line">    <span class="attribute">opacity</span> <span class="number">0.8</span></span><br><span class="line">  img</span><br><span class="line">    <span class="attribute">width</span> <span class="number">100%</span></span><br><span class="line">    <span class="attribute">height</span> <span class="number">100%</span></span><br><span class="line">    <span class="attribute">object-fit</span> cover</span><br><span class="line">    <span class="attribute">display</span> block</span><br><span class="line">    <span class="attribute">opacity</span> <span class="number">0</span></span><br><span class="line">    <span class="attribute">border-radius</span> <span class="number">5px</span></span><br><span class="line">    transition all .3s</span><br><span class="line"></span><br><span class="line">.blog-slider__content</span><br><span class="line">  <span class="attribute">padding-right</span> <span class="number">50px</span></span><br><span class="line">  <span class="attribute">padding-left</span> <span class="number">50px</span></span><br><span class="line">  &amp; &gt; *</span><br><span class="line">    <span class="attribute">opacity</span> <span class="number">0</span></span><br><span class="line">    <span class="attribute">transform</span> translateY(<span class="number">25px</span>)</span><br><span class="line">    transition all .4s</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">.blog-slider__code</span><br><span class="line">  <span class="attribute">color</span> var(--font-color)</span><br><span class="line">  <span class="attribute">margin-bottom</span> <span class="number">0px</span></span><br><span class="line">  <span class="attribute">display</span> block</span><br><span class="line">  <span class="attribute">font-weight</span> <span class="number">500</span></span><br><span class="line"></span><br><span class="line">.blog-slider__title</span><br><span class="line">  <span class="attribute">font-size</span> <span class="number">18px</span></span><br><span class="line">  <span class="attribute">font-weight</span> <span class="number">700</span></span><br><span class="line">  <span class="attribute">color</span> var(--font-color)</span><br><span class="line">  <span class="attribute">margin-bottom</span> <span class="number">15px</span></span><br><span class="line">  -webkit-line-clamp <span class="number">1</span></span><br><span class="line">  <span class="attribute">display</span> -webkit-box</span><br><span class="line">  <span class="attribute">overflow</span> hidden</span><br><span class="line">  -webkit-box-orient vertical</span><br><span class="line"></span><br><span class="line">.blog-slider__text</span><br><span class="line">  <span class="attribute">color</span> var(--font-color)</span><br><span class="line">  -webkit-line-clamp <span class="number">1</span></span><br><span class="line">  <span class="attribute">display</span> -webkit-box</span><br><span class="line">  <span class="attribute">overflow</span> hidden</span><br><span class="line">  -webkit-box-orient vertical</span><br><span class="line">  <span class="attribute">margin-bottom</span> <span class="number">15px</span></span><br><span class="line">  <span class="attribute">line-height</span> <span class="number">1.5em</span></span><br><span class="line">  <span class="attribute">width</span> <span class="number">100%</span></span><br><span class="line">  <span class="attribute">display</span> block</span><br><span class="line">  <span class="attribute">word-break</span> break-all</span><br><span class="line">  <span class="attribute">word-wrap</span> break-word</span><br><span class="line"></span><br><span class="line">.blog-slider__button</span><br><span class="line">  <span class="attribute">display</span> inline-flex</span><br><span class="line">  <span class="attribute">background-color</span> var(--btn-bg)</span><br><span class="line">  <span class="attribute">padding</span> <span class="number">4px</span> <span class="number">14px</span></span><br><span class="line">  <span class="attribute">border-radius</span> <span class="number">8px</span></span><br><span class="line">  <span class="attribute">color</span> var(--btn-color)</span><br><span class="line">  <span class="attribute">text-decoration</span> none</span><br><span class="line">  <span class="attribute">font-weight</span> <span class="number">500</span></span><br><span class="line">  <span class="attribute">justify-content</span> center</span><br><span class="line">  <span class="attribute">text-align</span> center</span><br><span class="line">  <span class="attribute">letter-spacing</span> <span class="number">1px</span></span><br><span class="line">  <span class="attribute">display</span> none</span><br><span class="line">  &amp;:hover</span><br><span class="line">    <span class="attribute">background-color</span> var(--btn-hover-color)</span><br><span class="line">    <span class="attribute">color</span> var(--btn-color)</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.blog-slider</span> <span class="selector-class">.swiper-container-horizontal</span> &gt; <span class="selector-class">.swiper-pagination-bullets</span>, <span class="selector-class">.blog-slider</span> <span class="selector-class">.swiper-pagination-custom</span>, <span class="selector-class">.blog-slider</span> .swiper-pagination-fraction</span><br><span class="line">  <span class="attribute">bottom</span> <span class="number">10px</span></span><br><span class="line">  <span class="attribute">left</span> <span class="number">0</span></span><br><span class="line">  <span class="attribute">width</span> <span class="number">100%</span></span><br><span class="line"></span><br><span class="line">.blog-slider__pagination</span><br><span class="line">  <span class="attribute">position</span> absolute</span><br><span class="line">  <span class="attribute">z-index</span> <span class="number">21</span></span><br><span class="line">  <span class="attribute">right</span> <span class="number">20px</span></span><br><span class="line">  <span class="attribute">width</span> <span class="number">11px</span> <span class="meta">!important</span></span><br><span class="line">  <span class="attribute">text-align</span> center</span><br><span class="line">  <span class="attribute">left</span> auto <span class="meta">!important</span></span><br><span class="line">  <span class="attribute">top</span> <span class="number">50%</span></span><br><span class="line">  <span class="attribute">bottom</span> auto <span class="meta">!important</span></span><br><span class="line">  <span class="attribute">transform</span> translateY(-<span class="number">50%</span>)</span><br><span class="line">  &amp;.swiper-pagination-bullets</span><br><span class="line">    .swiper-pagination-bullet</span><br><span class="line">      <span class="attribute">margin</span> <span class="number">8px</span> <span class="number">0</span></span><br><span class="line">  .swiper-pagination-bullet</span><br><span class="line">    <span class="attribute">width</span> <span class="number">11px</span></span><br><span class="line">    <span class="attribute">height</span> <span class="number">11px</span></span><br><span class="line">    <span class="attribute">display</span> block</span><br><span class="line">    <span class="attribute">border-radius</span> <span class="number">10px</span></span><br><span class="line">    <span class="attribute">background</span> <span class="number">#858585</span></span><br><span class="line">    <span class="attribute">opacity</span> <span class="number">0.2</span></span><br><span class="line">    transition all .3s</span><br><span class="line">  .swiper-pagination-bullet-active</span><br><span class="line">    <span class="attribute">opacity</span> <span class="number">1</span></span><br><span class="line">    <span class="attribute">background</span> var(--btn-bg)</span><br><span class="line">    <span class="attribute">height</span> <span class="number">30px</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">600px</span>)</span><br><span class="line">  .blog-slider__pagination</span><br><span class="line">    transform translateX(-<span class="number">50%</span>)</span><br><span class="line">    left <span class="number">50%</span> !important</span><br><span class="line">    top <span class="number">320px</span></span><br><span class="line">    <span class="attribute">width</span> <span class="number">100%</span> !important</span><br><span class="line">    display flex</span><br><span class="line">    justify-content center</span><br><span class="line">    align-items center</span><br><span class="line"></span><br><span class="line">  .blog-slider__pagination</span><br><span class="line">    &amp;.swiper-pagination-bullets</span><br><span class="line">      .swiper-pagination-bullet</span><br><span class="line">        margin <span class="number">0</span> <span class="number">5px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider__pagination</span><br><span class="line">    .swiper-pagination-bullet-active</span><br><span class="line">      <span class="attribute">height</span> <span class="number">11px</span></span><br><span class="line">      <span class="attribute">width</span> <span class="number">30px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider__button</span><br><span class="line">    display inline-flex</span><br><span class="line">    <span class="attribute">width</span> <span class="number">100%</span></span><br><span class="line">  .blog-slider__text</span><br><span class="line">    margin-bottom <span class="number">40px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider</span><br><span class="line">    <span class="attribute">min-height</span> <span class="number">350px</span></span><br><span class="line">    <span class="attribute">height</span> auto</span><br><span class="line">    margin-top <span class="number">110px</span></span><br><span class="line">    margin-bottom <span class="number">10px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider__content</span><br><span class="line">    margin-top -<span class="number">80px</span></span><br><span class="line">    text-align center</span><br><span class="line">    padding <span class="number">0</span> <span class="number">30px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider__item</span><br><span class="line">    flex-direction column</span><br><span class="line"></span><br><span class="line">  .blog-slider__img</span><br><span class="line">    transform translateY(-<span class="number">50%</span>)</span><br><span class="line">    <span class="attribute">width</span> <span class="number">90%</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">  .blog-slider__content</span><br><span class="line">    padding-left <span class="number">10px</span></span><br><span class="line">    padding-right <span class="number">10px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider__pagination.swiper-pagination-clickable.swiper-pagination-bullets</span><br><span class="line">    top <span class="number">110px</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">@media screen <span class="keyword">and</span> (<span class="attribute">min-width</span>: <span class="number">600px</span>)</span><br><span class="line">  .blog-slider</span><br><span class="line">    <span class="attribute">height</span> <span class="number">200px</span></span><br><span class="line"></span><br><span class="line">  .blog-slider__img</span><br><span class="line">    <span class="attribute">height</span> <span class="number">200px</span></span><br></pre></td></tr></table></figure>
</li>
<li>
<p>配置CDN依赖项。</p>
<ul>
<li>
<p>修改文件<code>_config.butterfly.yml</code>，在CDN模块下添加如下代码：</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 首页轮播图</span></span><br><span class="line">  <span class="attr">swiper_js:</span> <span class="string">https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.1.6/js/swiper.min.js</span> </span><br><span class="line">  <span class="attr">swiper_css:</span> <span class="string">https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.1.6/css/swiper.min.css</span> </span><br><span class="line">  <span class="attr">swiper_init:</span> <span class="string">/js/swiper_init.js</span> </span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/LBT2.png" alt=""></p>
</li>
<li>
<p>在路径<code>\themes\butterfly\source\css</code>下找到文件<code>index.styl</code>，在最上方添加如下代码：</p>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">@import</span> url(hexo-config(<span class="string">&#x27;CDN.swiper_css&#x27;</span>))</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/LBT3.png" alt=""></p>
</li>
</ul>
</li>
<li>
<p>在路径<code>\source\_data</code>下创建文件<code>slider.yml</code>，在里面填写想要置顶文章的信息</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># - cover: 封面图片链接</span></span><br><span class="line"><span class="comment">#   timeline: &#x27;2020-10-01&#x27; # 日期，需要用&#x27;&#x27;包裹</span></span><br><span class="line"><span class="comment">#   link: 置顶文章链接，站内文章建议填相对链接</span></span><br><span class="line"><span class="comment">#   title: 置顶文章标题</span></span><br><span class="line"><span class="comment">#   description: 置顶文章描述</span></span><br><span class="line"><span class="comment">#   button: 手机端按钮内容</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 例</span></span><br><span class="line"><span class="bullet">-</span> <span class="attr">cover:</span> <span class="string">https://cdn.jsdelivr.net/gh/CNhuazhu/Image/RotatingImage6.jpg</span></span><br><span class="line">  <span class="attr">timeline:</span> <span class="string">&#x27;2021-01-20&#x27;</span></span><br><span class="line">  <span class="attr">link:</span> <span class="string">/2021/01/20/Markdown语法/</span></span><br><span class="line">  <span class="attr">title:</span> <span class="string">Markdown语法</span></span><br><span class="line">  <span class="attr">description:</span> <span class="string">总结常用的Markdown语法</span></span><br><span class="line">  <span class="attr">button:</span> <span class="string">详情</span></span><br></pre></td></tr></table></figure>
</li>
</ol>
<hr>
<h1>结尾</h1>
<p>个人觉得还蛮实用的一个修改。</p>
</article><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Hexo/">Hexo</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/hexo2.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button button--animated"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/wechat.png" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/wechat.png" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/alipay.jpg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/alipay.jpg" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2021/02/20/GitHub+PicGo+jsDelivr搭建免费图床/" title="GitHub+PicGo+jsDelivr搭建免费图床"><img class="cover" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/tccover.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-02-20</div><div class="title">GitHub+PicGo+jsDelivr搭建免费图床</div></div></a></div><div><a href="/2021/01/21/Hexo快速搭建一个博客/" title="Hexo快速搭建一个博客"><img class="cover" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/Hexo1.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-21</div><div class="title">Hexo快速搭建一个博客</div></div></a></div><div><a href="/2021/01/20/Markdown语法/" title="Markdown语法"><img class="cover" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/page1.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-20</div><div class="title">Markdown语法</div></div></a></div><div><a href="/2021/02/19/关于Hexo添加豆瓣页面踩过的坑/" title="关于Hexo添加豆瓣页面踩过的坑"><img class="cover" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/hexo2.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-02-19</div><div class="title">关于Hexo添加豆瓣页面踩过的坑</div></div></a></div><div><a href="/2021/07/05/Hexo魔改/HexoMAC代码框样式美化/" title="HexoMAC代码框样式美化"><img class="cover" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/hexo2.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-07-05</div><div class="title">HexoMAC代码框样式美化</div></div></a></div><div><a href="/2021/02/25/Hexo魔改/Hexo修改友链界面/" title="Hexo修改友链界面"><img class="cover" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/hexo2.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-02-25</div><div class="title">Hexo修改友链界面</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div><div id="comment-switch"><span class="first-comment">Twikoo</span><span class="switch-btn"></span><span class="second-comment">Valine</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">花猪</div><div class="author-info__description">此站点就暂时停留在秋天了吧</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">86</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/CNhuazhu"><i class="fab fa-github"></i><span>我的github</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/CNhuazhu" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">花猪在此欢迎您光临小破站 (՞•Ꙫ•՞) <br><b>此站点已暂停更新！！！！</b><br><br>  <b><i>本站已部署至云服务器👇</i></b>：<a href="http://cnhuazhu.top">http://cnhuazhu.top</a> <br><br>  <b><i>github地址（暂停更新）</i></b>：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://cnhuazhu.github.io/">https://cnhuazhu.github.io/</a> <br> <b><i>码云地址（暂停更新）</i></b>：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://cnhuazhu.gitee.io">https://cnhuazhu.gitee.io</a> <br><br>  本站主题：Butterfly 3.7.8 <br> <img src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/pig.gif"></div><timing></timing></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link"><span class="toc-number">1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-1"><a class="toc-link"><span class="toc-number">2.</span> <span class="toc-text">操作</span></a></li><li class="toc-item toc-level-1"><a class="toc-link"><span class="toc-number">3.</span> <span class="toc-text">结尾</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/11/02/NodeJS/%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E4%B8%80%E4%B8%AAexpress%E6%9C%8D%E5%8A%A1%E5%99%A8/" title="快速搭建一个express服务器"><img src="https://gitee.com/CNhuazhu/tu-chuang1/raw/master/img-blog/Node_Express_cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="快速搭建一个express服务器"/></a><div class="content"><a class="title" href="/2021/11/02/NodeJS/%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E4%B8%80%E4%B8%AAexpress%E6%9C%8D%E5%8A%A1%E5%99%A8/" title="快速搭建一个express服务器">快速搭建一个express服务器</a><time datetime="2021-11-02T00:39:53.000Z" title="发表于 2021-11-02 08:39:53">2021-11-02</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/10/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu%EF%BC%89/Nginx-uWSGI-Flask%E9%83%A8%E7%BD%B2%E8%87%B3Ubuntu/" title="Nginx+uWSGI+Flask部署至Ubuntu"><img src="https://gitee.com/CNhuazhu/tu-chuang1/raw/master/img-blog/Ubuntu_Server_cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Nginx+uWSGI+Flask部署至Ubuntu"/></a><div class="content"><a class="title" href="/2021/10/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu%EF%BC%89/Nginx-uWSGI-Flask%E9%83%A8%E7%BD%B2%E8%87%B3Ubuntu/" title="Nginx+uWSGI+Flask部署至Ubuntu">Nginx+uWSGI+Flask部署至Ubuntu</a><time datetime="2021-10-28T03:01:09.000Z" title="发表于 2021-10-28 11:01:09">2021-10-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/10/18/Xftp%E4%BC%A0%E8%BE%93%E6%96%87%E4%BB%B6%E5%A4%B1%E8%B4%A5%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/" title="Xftp传输文件失败解决方案"><img src="https://gitee.com/CNhuazhu/tu-chuang1/raw/master/img-blog/Xftp_cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Xftp传输文件失败解决方案"/></a><div class="content"><a class="title" href="/2021/10/18/Xftp%E4%BC%A0%E8%BE%93%E6%96%87%E4%BB%B6%E5%A4%B1%E8%B4%A5%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/" title="Xftp传输文件失败解决方案">Xftp传输文件失败解决方案</a><time datetime="2021-10-18T09:50:16.000Z" title="发表于 2021-10-18 17:50:16">2021-10-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/10/13/%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu%EF%BC%89/Hexo%E9%83%A8%E7%BD%B2%E8%87%B3%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88%E7%BB%AD%EF%BC%89%E2%80%94%E2%80%94%E5%BB%BA%E7%AB%8B%E5%BC%95%E5%AF%BC%E9%A1%B5%E5%8F%8A%E5%88%86%E7%AB%99/" title="Hexo部署至服务器（续）——建立引导页及分站"><img src="https://gitee.com/CNhuazhu/tu-chuang1/raw/master/img-blog/Ubuntu_Server_cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo部署至服务器（续）——建立引导页及分站"/></a><div class="content"><a class="title" href="/2021/10/13/%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu%EF%BC%89/Hexo%E9%83%A8%E7%BD%B2%E8%87%B3%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88%E7%BB%AD%EF%BC%89%E2%80%94%E2%80%94%E5%BB%BA%E7%AB%8B%E5%BC%95%E5%AF%BC%E9%A1%B5%E5%8F%8A%E5%88%86%E7%AB%99/" title="Hexo部署至服务器（续）——建立引导页及分站">Hexo部署至服务器（续）——建立引导页及分站</a><time datetime="2021-10-13T13:49:12.000Z" title="发表于 2021-10-13 21:49:12">2021-10-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/10/12/%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu%EF%BC%89/Hexo%E9%83%A8%E7%BD%B2%E8%87%B3%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu-20-04%EF%BC%89/" title="Hexo部署至服务器（Ubuntu 20.04）"><img src="https://gitee.com/CNhuazhu/tu-chuang1/raw/master/img-blog/Ubuntu_Server_cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo部署至服务器（Ubuntu 20.04）"/></a><div class="content"><a class="title" href="/2021/10/12/%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu%EF%BC%89/Hexo%E9%83%A8%E7%BD%B2%E8%87%B3%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88Ubuntu-20-04%EF%BC%89/" title="Hexo部署至服务器（Ubuntu 20.04）">Hexo部署至服务器（Ubuntu 20.04）</a><time datetime="2021-10-12T07:13:40.000Z" title="发表于 2021-10-12 15:13:40">2021-10-12</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2021 By 花猪</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a target="_blank" rel="noopener external nofollow noreferrer" href="http://beian.miit.gov.cn/">蜀ICP备2021026748号</a><br>感谢光临<a href="http://cnhuazhu.top/" style="text-decoration:underline">小破站</a>,欢迎您提出宝贵的意见！</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script async="async">var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> {preloader.endLoading()})
setTimeout(function(){preloader.endLoading();}, 3000);</script></div><div class="js-pjax"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"><script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.css"><script>(() => {
  document.querySelectorAll('#article-container span.katex-display').forEach(item => {
    btf.wrap(item, 'div', '', 'katex-wrap')
  })
})()</script><script>(()=>{
  const $countDom = document.getElementById('twikoo-count')
  const init = () => {
    twikoo.init(Object.assign({
      el: '#twikoo-wrap',
      envId: 'hexo-1g41404w9f800e94',
      region: ''
    }, null))
  }

  const getCount = () => {
    twikoo.getCommentsCount({
      envId: 'hexo-1g41404w9f800e94',
      region: '',
      urls: [window.location.pathname],
      includeReply: false
    }).then(function (res) {
      $countDom.innerText = res[0].count
    }).catch(function (err) {
      console.error(err);
    });
  }

  const loadTwikoo = (bool = false) => {
    if (typeof twikoo === 'object') {
      init()
      bool && $countDom && setTimeout(getCount,0)
    } else {
      getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(()=> {
        init()
        bool && $countDom && setTimeout(getCount,0)
      })
    }
  }

  if ('Twikoo' === 'Twikoo' || !true) {
    if (true) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
    else loadTwikoo(true)
  } else {
    window.loadOtherComment = () => {
      loadTwikoo()
    }
  }
})()</script><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'VHoX95KsBQSMyzEc3TdpmBkF-MdYXbMMI',
      appKey: 'qnwObDMbgMEKnu1Gp8tk7PYJ',
      placeholder: '欢迎留下你的评论（昵称和邮箱为必填项）',
      avatar: 'monsterid',
      meta: 'nick,mail,link'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: false,
      serverURLs: '',
      emojiCDN: '',
      emojiMaps: "",
      enableQQ: false,
      path: window.location.pathname,
      requiredFields: ["nick,mail"],
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Twikoo' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script src="/js/ip_content.js"></script><script src="/js/timing.js"></script><script src="https://cdn.jsdelivr.net/gh/xiabo2/CDN@latest/fishes.js"></script><script src="/js/footer.js"></script><script src="/js/ginkgo-leaf.js"></script><script id="canvas_nest" defer="defer" color="0,0,0" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = false;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div class="pjax-reload"><script async="async">var arr = document.getElementsByClassName('recent-post-item');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__fadeInLeft');
    arr[i].setAttribute('data-wow-duration', '600ms');
    arr[i].setAttribute('data-wow-delay', '200ms');
    arr[i].setAttribute('data-wow-offset', '100');
    arr[i].setAttribute('data-wow-iteration', '1');
  }</script><script async="async">var arr = document.getElementsByClassName('card-widget');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__fadeInRightBig');
    arr[i].setAttribute('data-wow-duration', '');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script></div><script defer="defer" src="https://cdn.jsdelivr.net/gh/graingert/wow@1.3.0/dist/wow.min.js"></script><script defer="defer" src="/js/wow_init.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
                        function butterfly_swiper_injector_config(){
                          var parent_div_git = document.getElementById('recent-posts');
                          var item_html = '<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="2021/03/28/Hexo魔改/Hexo魔改记录/" alt=""><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/RotatingImage4.jpg" alt=""/></a><div class="blog-slider__content"><span class="blog-slider__code">2021-03-28</span><a class="blog-slider__title" href="2021/03/28/Hexo魔改/Hexo魔改记录/" alt="">Hexo魔改记录</a><div class="blog-slider__text">Hexo魔改记录</div><a class="blog-slider__button" href="2021/03/28/Hexo魔改/Hexo魔改记录/" alt="">详情   </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="2021/08/02/Vue/Vue学习笔记/" alt=""><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/RotatingImage5.jpg" alt=""/></a><div class="blog-slider__content"><span class="blog-slider__code">2021-08-02</span><a class="blog-slider__title" href="2021/08/02/Vue/Vue学习笔记/" alt="">Vue学习笔记</a><div class="blog-slider__text">本文将介绍Vue的基础语法</div><a class="blog-slider__button" href="2021/08/02/Vue/Vue学习笔记/" alt="">详情   </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="2021/03/28/Java/Java学习记录/" alt=""><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/RotatingImage8.jpg" alt=""/></a><div class="blog-slider__content"><span class="blog-slider__code">2021-03-28</span><a class="blog-slider__title" href="2021/03/28/Java/Java学习记录/" alt="">Java学习记录</a><div class="blog-slider__text">Java学习记录</div><a class="blog-slider__button" href="2021/03/28/Java/Java学习记录/" alt="">详情   </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="2021/03/28/操作系统/操作系统学习笔记/" alt=""><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/RotatingImage7.jpg" alt=""/></a><div class="blog-slider__content"><span class="blog-slider__code">2021-03-28</span><a class="blog-slider__title" href="2021/03/28/操作系统/操作系统学习笔记/" alt="">操作系统学习笔记</a><div class="blog-slider__text">记录操作系统学习历程</div><a class="blog-slider__button" href="2021/03/28/操作系统/操作系统学习笔记/" alt="">详情   </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="2021/03/28/计算机网络/计算机网络学习笔记/" alt=""><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/CNhuazhu/Image/RotatingImage3.jpg" alt=""/></a><div class="blog-slider__content"><span class="blog-slider__code">2021-03-28</span><a class="blog-slider__title" href="2021/03/28/计算机网络/计算机网络学习笔记/" alt="">计算机网络学习笔记</a><div class="blog-slider__text">记录计算机网络学习历程</div><a class="blog-slider__button" href="2021/03/28/计算机网络/计算机网络学习笔记/" alt="">详情   </a></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div></div></div>';
                          console.log('已挂载butterfly_swiper')
                          // parent_div_git.innerHTML=item_html+parent_div_git.innerHTML // 无报错，但不影响使用(支持pjax跳转)
                          parent_div_git.insertAdjacentHTML("afterbegin",item_html) // 有报错，但不影响使用(支持pjax跳转)
                          }
                        if( document.getElementById('recent-posts') && (location.pathname ==='all'|| 'all' ==='all')){
                        butterfly_swiper_injector_config()
                        }
                      </script><script defer src="https://cdn.jsdelivr.net/npm/hexo-butterfly-swiper/lib/swiper.min.js"></script><script defer data-pjax src="https://cdn.jsdelivr.net/npm/hexo-butterfly-swiper/lib/swiper_init.js"></script><!-- hexo injector body_end end --><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/live2dw/assets/assets/tororo.model.json"},"display":{"superSample":2,"width":200,"height":400,"position":"left","hOffset":0,"vOffset":-105},"mobile":{"show":false,"scale":0.5},"react":{"opacityDefault":0.7,"opacityOnHover":0.8},"log":false});</script></body></html>